package com.cherrish.demo.provider;

import com.cherrish.demo.framework.Protocol;
import com.cherrish.demo.framework.ProtocolFactory;
import com.cherrish.demo.framework.URL;
import com.cherrish.demo.provider.api.HelloService;
import com.cherrish.demo.provider.impl.HelloServiceImpl;
import com.cherrish.demo.register.Register;

/**
 * @author cherrish
 * @time 2019-03-20 16:09
 * @name Provider
 * @desc:
 */
public class Provider {
    public static void main(String[] args) {
        URL url = new URL("localhost", 8080);
        Register.register(url, HelloService.class.getName(), HelloServiceImpl.class);

        /*HttpServer httpServer = new HttpServer();
        httpServer.start(url.getHostname(), url.getPort());*/

        //协议切换
        Protocol protocol = ProtocolFactory.getProtocol();
        protocol.start(url);
    }
}
